#include <stdio.h>
#include <string.h>

void reverseString(char str[]) {
    int length = strlen(str);
    int i, j;
    char temp;
    
    for(i = 0, j = length-1; i < j; i++, j--) {
        temp = str[i];
        str[i] = str[j];
        str[j] = temp;
    }
}

int main() {
    char a[] = "apple";
    
    printf("原字符串: %s\n", a);
    reverseString(a);
    printf("逆转后: %s\n", a);
    
    return 0;
}